// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace NSQL.Sharpen
{
    public interface IDeepClone
    {
        object DeepCopy();
    }
    
    public static class DeepCloneExtensions
    {
        public static T DeepClone<T>(this T self) where T : IDeepClone
        {
            if (ReferenceEquals(self, null)) return default;
            return (T) self.DeepCopy();
        }
    }
}